<?php
/*
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 */
$styleSheet = "orange";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="../../scripts/archive.js"></script>
<script type="text/javascript" src="../../scripts/time.js"></script>

<link href="../../themes/<?php echo $styleSheet;?>/css/leave.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../themes/<?php echo $styleSheet;?>/scripts/style.js"></script>
<link href="../../themes/<?php echo $styleSheet;?>/css/style.css" rel="stylesheet" type="text/css"/>
<!--[if lte IE 6]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE6_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<!--[if IE]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<script>
function checkForm(myform) {
	if(myform.user_name.value==""){
		alert('用户账号不允许为空');
		return false;
	}
	/*if(myform.user_password.value==""){
		alert('密码不允许为空');
		return false;
	}*/
	if(myform.user_password.value!=myform.user_password2.value){
		alert('两次输入的密码不一致');
		return false;
	}
	if(myform.first_name.value==""){
		alert('昵称不允许为空');
		return false;
	}
	if(myform.emp_number.value==0 || !myform.emp_number.value){
		alert('用户账户必须关联员工');
		return false;
	}
	return true;
}
</script>
</head>
<body class="yui-skin-sam">

<div class="outerbox">
    <div class="outerbox"><div class="top"><div class="left"></div><div class="right"></div><div class="middle"></div></div><div class="maincontent">
        <div class="mainHeading"><h2><font color="#ff0000"></font> 修改用户信息</h2></div>


   <div class="actionbar">
    <br class="clear">
    </div>
    <br class="clear">
    <form id="frmListOfShifts" name="frmListOfShifts" method="post" action="?ctrl=user&action=saveOneShow" onsubmit="return checkForm(this);">
    	<input type="hidden" name="username" value="<?php echo $records['info']['user_name'];?>"/>
    	<table >
	    	<tbody> 
	    		<tr>
			    	<td>
			    	 账号:
			    	</td>
			    	<td>
			    	 <input type="text"  name="user_name" value="<?php echo $records['info']['user_name'];?>"/>
			    	</td>
		    	</tr>	
	    		<tr>
			    	<td>
			    	 密码:
			    	</td>
			    	<td>
			    	 <input type="password" name="user_password" value=""/><font color="Red"> 如果不需要修改密码，请留空</font>
			    	</td>
		    	</tr>
		    	<tr>
			    	<td>
			    	 确认密码:
			    	</td>
			    	<td>
			    	 <input type="password" name="user_password2" value=""/>
			    	</td>
		    	</tr>
	    		<tr>
			    	<td>
			    	 昵称:
			    	</td>
			    	<td>
			    	 <input type="text"  name="first_name"    value="<?php echo $records['info']['first_name'];?>"/>
			    	</td>
		    	</tr>
				<tr>
			    	<td>
			    	 关联员工:
			    	</td>
			    	<td>
			    	    <select name="emp_number" >
						<option value="0"   >请选择关联员工</option>
						<?php if (!empty($records['empList'])) {
							foreach ($records['empList'] as $rp) {
								$isSelected='';
								if ($rp['emp_number']==$records['info']['emp_number']) {
									$isSelected=" selected ";
								}
						?>
						<option value="<?php echo $rp['emp_number'] ?>"  <?php echo $isSelected;?> ><?php echo $rp['employee_id'].'(员工号)-----'.$rp['emp_firstname'].''; ?></option>
						<?php } 
						} ?>
						</select> 
			    	</td>
		    	</tr>
	    		<tr>
			    	<td>
			    	 操作:
			    	</td>
			    	<td>
			    	 <input type="submit"  value="保存" />
			    	</td>
		    	</tr>
	    	</tbody>
    	</table>
      </form>
  </div><div class="bottom"><div class="left"></div><div class="right"></div><div class="middle"></div></div></div>
</div>
 
</body>
</html>
